package com.mmd.admin.model.pojo.request.mer;

import com.mmd.admin.model.enums.LoginStrategy;
import com.mmd.base.annotation.MobileValid;


import com.mmd.core.constant.ValidGroup;
import com.mmd.core.enums.LoginEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@ApiModel("MER-商家端登录参数")
public class MerLoginParam {
    @NotBlank(message = "账号不可为空", groups = {ValidGroup.Password.class, ValidGroup.Code.class})
    @MobileValid(message = "账号或密码错误", groups = {ValidGroup.Password.class, ValidGroup.Code.class})
    @ApiModelProperty("登录账号")
    private String phone;
    @NotBlank(message = "密码或验证码不可为空", groups = {ValidGroup.Password.class, ValidGroup.Code.class})
    @Length(min = 6, max = 18, message = "账号密码或验证码错误", groups = {ValidGroup.Password.class, ValidGroup.Code.class})
    @ApiModelProperty("安全密钥=>登陆密码或验证码")
    private String secretKey;
    @NotNull(message = "请选择登录策略", groups = {ValidGroup.Password.class, ValidGroup.Code.class, ValidGroup.Alipay.class, ValidGroup.Wechat.class, ValidGroup.Phone.class})
    @ApiModelProperty("登录策略")
    private LoginStrategy loginStrategy;
    @NotNull(message = "请选择登录类型", groups = {ValidGroup.Password.class, ValidGroup.Code.class, ValidGroup.Alipay.class, ValidGroup.Wechat.class})
    @ApiModelProperty("登录类型")
    private LoginEnum loginEnum;
}
